// 字面量  const age: 18
// 使用 js字面量 【作为变量类型】，这种类型就是字面量类型。
const age = 18;

// Pick和Omit
type Person = {
  age: number;
  name: string;
  gender: string;
  hobby: string[];
};
// 获取指定类型
type NewPerson = Pick<Person, "name" | "age">;
const p1: NewPerson = {
  age: 5,
  name: "张三",
};

// 排除不要的类型

type NewPerson2 = Omit<Person, "gender">;
const p2: NewPerson2 = {
  age: 5,
  name: "张三",
  hobby: ["打球", "画画"],
};
